clear

global b;
global I;
global Ki;
%KArr = [0:0.000001:0.00001];
%K = KArr(1);
b = 0.02;
I = 0.004;

KArr = [0.0000001, 0.000001, 0.00001, 0.0001, 0.001, 0.01];
colors = {'bd', 'b+', 'b*', 'b--', 'bx', 'bo'}; %, 'bs', 'b^'};
labels = {'k=10^-5','k=10^-4','k=10^-3','k=10^-2','k=10^-1','k=1', 'thetaR'};%,'k=15','k=20', 'Tout(t)'};

for i=1:length(KArr)
    Ki=KArr(i);
    [T Z]=rk4sgral(0,1000,[0,0,0],10000,'thetapuntod');
    subT=T(1:10:length(T));
    subZ=Z(:,1);
    subZ=subZ(1:10:length(Z(:,1)));
    p(i) = plot(subT, subZ, colors{i});
    %, T', Z(:,2), 'b^'
    hold on;
end

ind=(1:length(labels));
p(i+1) = plot(T, thetaR(T), 'r-');
legend(p(ind), labels{ind}, 'Location', 'NorthEastOutside');

xlabel('tiempo (s)');
ylabel('theta');

hold off;
axis([0,900,0,10]); % fixed

%res(:,1), thetaR(res(:,1)), 'b-');
